home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume29 / zsh2.2 / part05 < prev    next >
Encoding:
Text File  |  1992-05-13  |  49.1 KB  |  1,584 lines

  1. Newsgroups: comp.sources.misc
  2. From: pfalstad@phoenix.Princeton.EDU (Paul Falstad)
  3. Subject:  v29i101:  zsh2.2 - The Z shell, Part05/17
  4. Message-ID: <1992May13.155855.8883@sparky.imd.sterling.com>
  5. X-Md4-Signature: 30e617310b385a8a79d232cff6bf0558
  6. Date: Wed, 13 May 1992 15:58:55 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: pfalstad@phoenix.Princeton.EDU (Paul Falstad)
  10. Posting-number: Volume 29, Issue 101
  11. Archive-name: zsh2.2/part05
  12. Environment: BSD
  13. Supersedes: zsh2.1: Volume 24, Issue 1-19
  14.  
  15. #!/bin/sh
  16. # this is aa.05 (part 5 of zsh2.2)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file zsh2.2/man/man1/zsh.1 continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 5; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping zsh2.2/man/man1/zsh.1'
  34. else
  35. echo 'x - continuing file zsh2.2/man/man1/zsh.1'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'zsh2.2/man/man1/zsh.1' &&
  37. Xon the commands.
  38. XIf the \-\fBl\fP flag is given, the resulting commands are listed on
  39. Xstandard output.
  40. XOtherwise the editor program \fIename\fP is invoked on a file containing
  41. Xthese history events.  If \fIename\fP is not given, the value
  42. Xof the parameter \fBFCEDIT\fP is used.  If \fIename\fP is "\-",
  43. Xno editor is invoked.  When editing is complete, the edited
  44. Xcommand(s) is executed.  
  45. XIf \fIfirst\fP is not specified, it will be set to \-1 (the most recent
  46. Xevent), or to -16 if the \-\fBl\fP flag is given.
  47. XIf \fIlast\fP is not specified, it will be set to \fIfirst\fP,
  48. Xor to \-1 if the \-\fBl\fP flag is given.
  49. XThe flag \-\fBr\fP reverses the order of the commands and the
  50. Xflag \-\fBn\fP suppresses command numbers when listing.
  51. XAlso when listing, \-\fBd\fP prints datestamps for each command,
  52. Xand \-\fBD\fP prints real execution times.
  53. X.RS
  54. X.PP
  55. X\fBfc\fP \-\fBR\fP reads the history from the given file,
  56. X\fBfc\fP \-\fBW\fP writes the history out to the given file,
  57. Xand \fBfc\fP \-\fBA\fP appends the history out to the given file.
  58. X.RE
  59. X.TP
  60. X.PD 0
  61. X\fBfg\fP [ \fIjob\fP ... ]
  62. X.TP
  63. X\fIjob\fP ...
  64. X.PD
  65. XBring the specified \fIjob\fPs to the foreground.
  66. XIf no \fIjob\fP is specified, use the current job.
  67. X.TP
  68. X\fBfunctions\fP [ \(+-\fBtu\fP ] [ \fIname\fP ... ]
  69. XEquivalent to \fBtypeset\fP \-\fBf\fP.
  70. X.TP
  71. X\fBgetln\fP \fIname\fP ...
  72. XRead the top value from the buffer stack and put it in
  73. Xthe shell parameter \fIname\fP.  Equivalent to
  74. X\fBread\fP \-\fBzr\fP.
  75. X.TP
  76. X\fBgetopts\fP \fIoptstring\fP \fIname\fP [ \fIarg\fP ... ]
  77. XChecks \fBarg\fP for legal options.  If \fIarg\fP is omitted,
  78. Xuse the positional parameters.  A valid option argument
  79. Xbegins with a + or a \-.  An argument not beginning with
  80. Xa + or a \-, or the argument \-\-, ends the options.
  81. X\fIoptstring\fP contains the letters that \fBgetopts\fP
  82. Xrecognizes.  If a letter is followed by a `:', that option
  83. Xis expected to have an argument.  The options can be
  84. Xseparated from the argument by blanks.
  85. X.RS
  86. X.PP
  87. XEach time it is invoked, \fBgetopts\fP places the option letter it finds
  88. Xin the shell parameter \fIname\fP, prepended with a + when
  89. X\fIarg\fP begins with a +.  The index of the next \fIarg\fP
  90. Xis stored in \fBOPTIND\fP.  The option argument, if any,
  91. Xis stored in \fBOPTARG\fP.
  92. X.PP
  93. XA leading : in \fIoptstring\fP causes \fBgetopts\fP to store the
  94. Xletter of the invalid option in \fBOPTARG\fP, and to set \fIname\fP
  95. Xto `?' for an unknown option and to `:' when a required option
  96. Xis missing.  Otherwise, \fBgetopts\fP prints an error
  97. Xmessage.  The exit status is nonzero when there are no more options.
  98. X.RE
  99. X.TP
  100. X\fBhash\fP \fIname\fP \fIpath\fP
  101. XPuts \fIname\fP in the command hash table, associating it with
  102. Xthe pathname \fIpath\fP.  Whenever \fIname\fP is used as a command
  103. Xargument, the shell will try to execute the file given by \fIpath\fP.
  104. X.TP
  105. X\fBhistory\fP [ \-\fBnr\fP ] [ \fIfirst\fP [ \fIlast\fP ] ]
  106. XSame as \fBfc\fP \-\fBl\fP.
  107. X.TP
  108. X\fBinteger\fP
  109. XSame as \fBtypeset\fP \-\fBi\fP.
  110. X.TP
  111. X\fBjobs\fP [ \-\fBlp\fP ] [ \fIjob\fP ... ]
  112. XLists information about each given job, or all jobs
  113. Xif \fIjob\fP is omitted.  The \-\fBl\fP flag lists process
  114. Xids, and the \-\fBp\fP flag lists process groups.
  115. X.TP
  116. X.PD 0
  117. X\fBkill\fP [ \-\fIsig\fP ] \fIjob\fP ...
  118. X.TP
  119. X\fBkill\fP \-\fBl\fP
  120. X.PD
  121. XSends either SIGTERM or the specified signal to the given
  122. Xjobs or processes.
  123. XSignals are given by number or by names
  124. X(with the prefix "SIG" removed).
  125. XIf the signal being sent is not KILL or CONT, then the job
  126. Xwill be sent a CONT signal if it is stopped.
  127. XThe argument \fIjob\fP can be the process id of a job
  128. Xnot in the job list.
  129. XIn the second form, \fBkill\fP \-\fBl\fP, the signal names
  130. Xare listed.
  131. X.TP
  132. X\fBlet\fP \fIarg\fP ...
  133. XEvaluate each \fIarg\fP as an arithmetic expression.
  134. XSee \fBARITHMETIC EVALUATION\fP above for a description
  135. Xof arithmetic expressions.  The exit status is 0 if the
  136. Xvalue of the last expression is nonzero, and 1 otherwise.
  137. X.TP
  138. X.PD 0
  139. X\fBlimit\fP [ \-\fBh\fP ] [ \fIresource\fP [ \fIlimit\fP ] ] ...
  140. X.TP
  141. X\fBlimit\fP \-\fBs\fP
  142. X.PD
  143. XLimit the resource consumption of children of the current shell.
  144. XIf \fIlimit\fP is not specified, print the current limit placed
  145. Xon \fIresource\fP; otherwise
  146. Xset the limit to the specified value.  If the \-\fBh\fP flag
  147. Xis given, use hard limits instead of soft limits.
  148. XIf no \fIresource\fP is given, print all limits.
  149. X.RS
  150. X.PP
  151. X\fIresource\fP is one of:
  152. X.PP
  153. X.PD 0
  154. X.TP
  155. X.B cputime
  156. XMaximum CPU seconds per process.
  157. X.TP
  158. X.B filesize
  159. XLargest single file allowed.
  160. X.TP
  161. X.B datasize
  162. XMaximum data size (including stack) for each process.
  163. X.TP
  164. X.B stacksize
  165. XMaximum stack size for each process.
  166. X.TP
  167. X.B coredumpsize
  168. XMaximum size of a core dump.
  169. X.TP
  170. X.B resident
  171. XMaximum resident set size.
  172. X.TP
  173. X.B descriptors
  174. XMaximum value for a file descriptor.
  175. X.PD
  176. X.PP
  177. X\fIlimit\fP is a number, with an optional scaling factor, as follows:
  178. X.PP
  179. X.PD 0
  180. X.TP
  181. X\fIn\fPh
  182. Xhours.
  183. X.TP
  184. X\fIn\fPk
  185. Xkilobytes. 
  186. XThis is the default for all but cputime.
  187. X.TP
  188. X\fIn\fPm
  189. Xmegabytes or minutes.
  190. X.TP
  191. X\fImm\fP:\fBss\fP
  192. Xminutes and seconds.
  193. X.PD
  194. X.RE
  195. X.TP
  196. X\fBlocal\fP
  197. XSame as \fBtypeset\fP.
  198. X.TP
  199. X\fBlog\fP
  200. XList all users currently logged in who are affected by
  201. Xthe current setting of the \fBwatch\fP parameter.
  202. X.TP
  203. X\fBlogout\fP
  204. XExit the shell, if this is a login shell.
  205. X.TP
  206. X\fBpopd\fP [ \(+-\fIn\fP ]
  207. XRemoves entries from the directory stack.  With no arguments,
  208. Xremoves the top directory from the stack, and performs a \fBcd\fP
  209. Xto the new top directory.  With an argument of the form +\fIn\fP,
  210. Xremove the \fIn\fPth entry counting from the left of the list
  211. Xshown by the \fBdirs\fP command, starting with zero, and change
  212. Xto that directory.  With an argument of the form \-\fIn\fP,
  213. Xremove the \fIn\fPth entry counting from the right.
  214. XIf the \fBPUSHD_MINUS\fP option is set, the meanings of +
  215. Xand \- in this context are swapped.
  216. X.TP
  217. X\fBprint\fP [ \-\fBRnrslzpNDP\fP ] [ \-\fBu\fP\fIn\fP ] [ \fIarg\fP ... ]
  218. XWith no flags or with flag \-, the arguments are printed on
  219. Xthe standard output as described by \fBecho\fP.
  220. X.RS
  221. X.PD 0
  222. X.TP
  223. X\-\fBR\fP, \-\fBr\fP
  224. Xignore the escape conventions of \fBecho\fP.
  225. XThe \-\fBR\fP option will print all subsequent
  226. Xarguments and options.
  227. X.TP
  228. X\-\fBs\fP
  229. Xplace the results in the history list instead of on the standard output.
  230. X.TP
  231. X\-\fBn\fP
  232. Xdo not add a newline to the output.
  233. X.TP
  234. X\-\fBl\fP
  235. Xprint the arguments separated by newlines instead of spaces.
  236. X.TP
  237. X\-\fBN\fP
  238. Xprint the arguments separated and terminated by nulls.
  239. X.TP
  240. X\-\fBu\fP\fIn\fP
  241. Xprint the arguments to file descriptor \fIn\fP.
  242. X.TP
  243. X\-\fBp\fP
  244. Xprint the arguments to the input of the coprocess.
  245. X.TP
  246. X\-\fBz\fP
  247. Xpush the arguments onto the editing buffer stack, separated by spaces;
  248. Xno escape sequences are recognized.
  249. X.TP
  250. X\-\fBD\fP
  251. Xtreat the arguments as directory names, replacing prefixes with ~
  252. Xexpressions, as appropriate.
  253. X.TP
  254. X\-\fBP\fP
  255. Xrecognize the same escape sequences as in the \fBPROMPT\fP parameter.
  256. X.PD
  257. X.RE
  258. X.TP
  259. X.PD 0
  260. X\fBpushd\fP [ \fIarg\fP ]
  261. X.TP
  262. X\fBpushd\fP \fIold\fP \fInew\fP
  263. X.TP
  264. X\fBpushd\fP \(+-\fBn\fP
  265. X.PD
  266. XChange the current directory, and push the old current directory
  267. Xonto the directory stack.  In the first form, change the
  268. Xcurrent directory to \fIarg\fP.
  269. XIf \fIarg\fP is not specified, change to the second directory
  270. Xon the stack (that is, exchange the top two entries), or
  271. Xchange to the value of \fBHOME\fP if the \fBPUSHD_TO_HOME\fP
  272. Xoption is set or if there is only one entry on the stack.
  273. XIf \fIarg\fP is \-, change to the
  274. Xvalue of \fBOLDPWD\fP, the previous directory.
  275. XIf a directory named \fIarg\fP is not found in the current directory
  276. Xand \fIarg\fP does not contain a slash,
  277. Xsearch each component of the shell parameter \fBcdpath\fP.
  278. XIf the option \fBCDABLEVARS\fP is set, and a parameter named \fIarg\fP
  279. Xexists whose value begins with a slash, treat its value as
  280. Xthe directory.
  281. XIf the option \fBPUSHD_SILENT\fP is not set, the directory
  282. Xstack will be printed after a \fBpushd\fP is performed.
  283. X.RS
  284. X.PP
  285. XThe second form of \fBpushd\fP substitutes the string \fInew\fP
  286. Xfor the string \fIold\fP in the name of the current directory,
  287. Xand tries to change to this new directory.
  288. X.PP
  289. XThe third form of \fBpushd\fP is equivalent to \fBpopd\fP.
  290. X.RE
  291. X.TP
  292. X\fBpwd\fP
  293. XEquivalent to \fBprint \-R $PWD\fP.
  294. X.TP
  295. X\fBr\fP
  296. XEquivalent to \fBfc \-e \-\fP.
  297. X.TP
  298. X\fBread\fP [ \-\fBrzp\fP ] [ \-\fBu\fIn\fR ] [ \fIname\fP?\fIprompt\fP ] [ \fIname\fP ...  ]
  299. XRead one line and break it into fields using the characters
  300. Xin \fBIFS\fP as separators.  In raw mode, \-\fBr\fP, a \e
  301. Xat the end of a line does not signify line continuation.
  302. XIf the \-\fBz\fP flag is set, read from the editor buffer stack.
  303. XThe first field is assigned to the first \fIname\fP, the second field
  304. Xto the second \fIname\fP, etc., with leftover
  305. Xfields assigned to the last \fIname\fP.
  306. XIf \fIname\fP is omitted then \fBREPLY\fP is used.
  307. XIf \-\fBu\fIn\fR is specified, then input is read from file
  308. Xdescriptor \fIn\fP; if \-\fBp\fP is specified, then input is
  309. Xread from the coprocess.
  310. XThe exit status is 0 unless end-of-file is encountered.
  311. XIf the first argument contains a \fB?\fP, the remainder of this
  312. Xword is used as a \fIprompt\fP on standard error when the shell
  313. Xis interactive.  The exit status is 0 unless an end-of-file
  314. Xis encountered.
  315. X.TP
  316. X\fBreadonly\fP [ \fIname\fP[=\fIvalue\fP] ] ...
  317. XThe given \fInames\fP are marked readonly; these names
  318. Xcannot be changed by subsequent assignment.
  319. X.TP
  320. X\fBrehash\fP [ \-\fBf\fP ]
  321. XThrow out the command hash table and start over.
  322. XIf the \-\fBf\fP option is set, rescan the command path
  323. Ximmediately, instead of rebuilding the hash table incrementally.
  324. X.TP
  325. X\fBreturn\fP [ \fIn\fP ]
  326. XCauses a shell function or \fB\&.\fP script to return to
  327. Xthe invoking script
  328. Xwith the return status specified by \fIn\fP.  If \fIn\fP
  329. Xis omitted then the return status is that of the last command
  330. Xexecuted.
  331. X.TP
  332. X.PD 0
  333. X\fBsched\fP [+]\fIhh\fP:\fImm\fP \fIcommand\fP ...
  334. X.TP
  335. X\fBsched\fP [ \-\fIitem\fP ]
  336. X.PD
  337. XMake an entry in the scheduled list of commands to execute.
  338. XThe time may be specified in either absolute or relative time.
  339. XWith no arguments, prints the list of scheduled commands.
  340. XWith the argument \-\fIitem\fP, removes the given item
  341. Xfrom the list.
  342. X.TP
  343. X\fBset\fP [ \(+-\fIoptions\fP ] [ \(+-\fBo\fP \fIoption name\fP ] ... [ \-\fBA\fP \fIname\fP ] [ \fIarg\fP ] ...
  344. XSet the options for the shell and/or set the positional parameters, or
  345. Xdeclare an array.  For the meaning of the flags, see
  346. X\fBOPTIONS\fP above.
  347. XFlags may be specified by name using the \-\fBo\fP option.
  348. XIf the \-\fBA\fP flag is specified, \fIname\fP is set to an
  349. Xarray containing the given \fIarg\fPs.
  350. XOtherwise the positional parameters are set.
  351. XIf no arguments are given, then the names and values
  352. Xof all parameters are printed on the standard output.
  353. XIf the only argument is +, the names of all parameters are printed.
  354. X.TP
  355. X\fBsetopt\fP [ \(+-\fIoptions\fP ] [ \fIname\fP ... ]
  356. XSet the options for the shell.  All options specified either
  357. Xwith flags or by name are set.  If no arguments are supplied,
  358. Xthe names of all options currently set are printed.
  359. XIn option names, case is insignificant, and all underscore
  360. Xcharacters are ignored.
  361. X.TP
  362. X\fBshift\fP [ \fIn\fP ]
  363. XThe positional parameters from $\fIn\fP+\fB1\fP ... are renamed
  364. X$\fB1\fP, where \fIn\fP is an arithmetic expression that
  365. Xdefaults to 1.
  366. X.TP
  367. X\fBsource\fP
  368. XSame as \fB.\fP.
  369. X.TP
  370. X\fBsuspend\fP [ \-\fBf\fP ]
  371. XSuspend the execution of the shell (send it a \fBSIGTSTP\fP)
  372. Xuntil it receives a \fBSIGCONT\fP.
  373. XIf the \-\fBf\fP option is not given, complain if this is a login shell.
  374. X.TP
  375. X.PD 0
  376. X\fBtest\fP \fIarg\fP ...
  377. X.TP
  378. X\fB[\fP \fIarg\fP ... \fB]\fP
  379. X.PD
  380. XLike the system version of \fBtest\fP.  Added for compatibility;
  381. Xuse conditional expressions instead.
  382. X.TP
  383. X\fBtimes\fP
  384. XPrint the accumulated user and system times for the shell
  385. Xand for processes run from the shell.
  386. X.TP
  387. X\fBtrap\fP [ \fIarg\fP ] [ \fIsig\fP ] ...
  388. X\fIarg\fP is a command to be read and executed when the shell
  389. Xreceives \fIsig\fP.  Each \fIsig\fP can be given as a number
  390. Xor as the name of a signal.
  391. XIf \fIarg\fP is \-, then all traps \fIsig\fP are reset to their
  392. Xdefault values.  If \fIarg\fP is the null string, then this signal
  393. Xis ignored by the shell and by the commands it invokes.
  394. XIf \fIsig\fP is \fBERR\fP then \fIarg\fP will be executed
  395. Xafter each command.
  396. XIf \fIsig\fP is \fB0\fP or \fBEXIT\fP
  397. Xand the \fBtrap\fP statement is executed inside the body of a function,
  398. Xthen the command \fIarg\fP is executed after the function completes.
  399. XIf \fIsig\fP is \fB0\fP or \fBEXIT\fP
  400. Xand the \fBtrap\fP statement is not executed inside the body of a function,
  401. Xthen the command \fIarg\fP is executed when the shell terminates.
  402. XThe \fBtrap\fP command with no arguments prints a list of commands
  403. Xassociated with each signal.
  404. X.TP
  405. X\fBtrue\fP
  406. XDo nothing and return an exit code of 0.
  407. X.TP
  408. X\fBttyctl\fP \-\fBfu\fP
  409. XThe \-\fBf\fP option freezes the tty, and \-\fBu\fP unfreezes it.
  410. XWhen the tty is frozen, no changes made to the tty settings by
  411. Xexternal programs will be honored by the shell; the shell will
  412. Xsimply reset the settings to their previous values as soon as each
  413. Xcommand exits.  Thus, \fBstty\fP and similar programs have no
  414. Xeffect when the tty is frozen.
  415. X.TP
  416. X\fBtype\fP
  417. XSame as \fBwhence\fP \-\fBv\fP.
  418. X.TP
  419. X\fBtypeset\fP [ \(+-\fBLRZfilrtux [\fIn\fP]] [ \fIname\fP[=\fIvalue\fP] ] ...
  420. XSet attributes and values for shell parameters.
  421. XWhen invoked inside a function, if \fIname\fP is not already
  422. Xdefined, a new parameter is created which will be unset when the
  423. Xfunction completes.
  424. XThe following attributes are valid:
  425. X.RS
  426. X.PD 0
  427. X.TP
  428. X\-\fBL\fP
  429. XLeft justify and remove leading blanks from \fIvalue\fP.
  430. XIf \fIn\fP is nonzero, it defines the width of the field;
  431. Xotherwise it is determined by the width of the value of the first
  432. Xassignment.
  433. XWhen the parameter is printed, it is filled on the right with
  434. Xblanks or truncated if necessary to fit the field.
  435. XLeading zeros are removed if the \-\fBZ\fP flag is also set.
  436. X.TP
  437. X\-\fBR\fP
  438. XRight justify and fill with leading blanks.  If \fIn\fP is nonzero
  439. Xif defines the width of the field;
  440. Xotherwise it is determined by the width of the value of the first
  441. Xassignment.
  442. XWhen the parameter is printed, the field is left filled with
  443. Xblanks or truncated from the end.
  444. X.TP
  445. X\-\fBZ\fP
  446. XRight justify and fill with leading zeros if the first non-blank
  447. Xcharacter is a digit and the \-\fBL\fP flag has not been set.
  448. XIf \fIn\fP is nonzero it defines the width of the field;
  449. Xotherwise it is determined by the width of the value of the
  450. Xfirst assignment.
  451. X.TP
  452. X\-\fBf\fP
  453. XThe names refer to functions rather than parameters.  No assignments
  454. Xcan be made, and the only other valid flags are \-\fBt\fP
  455. Xand \-\fBu\fP.  The flag \-\fBt\fP turns on execution tracing for this
  456. Xfunction.  The flag \-\fBu\fP causes this function to be marked
  457. Xfor autoloading.  The \fBfpath\fP parameter will be searched to find the
  458. Xfunction definition when the function is first referenced.
  459. X.TP
  460. X\-\fBi\fP
  461. XUse an internal integer representation.  If \fBi\fP is nonzero
  462. Xit defines the output arithmetic base, otherwise it is determined by the first
  463. Xassignment.
  464. X.TP
  465. X\-\fBl\fP
  466. XConvert to lower case.
  467. X.TP
  468. X\-\fBr\fP
  469. XThe given \fIname\fPs are marked readonly.
  470. X.TP
  471. X\-\fBt\fP
  472. XTags the named parameters.  Tags have no special meaning to the shell.
  473. X.TP
  474. X\-\fBu\fP
  475. XConvert to upper case.
  476. X.TP
  477. X\-\fBx\fP
  478. XMark for automatic export to the environment of subsequently
  479. Xexecuted commands.
  480. X.RE
  481. X.PD
  482. X.PP
  483. XUsing + rather than \- causes these flags to be turned off.
  484. XIf no arguments are given but flags are specified,
  485. Xa list of named parameters which have these flags set is printed.
  486. XUsing + instead of \- keeps their values from being printed.
  487. XIf no arguments or options are given, the names and attributes
  488. Xof all parameters are printed.
  489. X.TP
  490. X\fBulimit\fP [ \-\fBHSacdfmnt\fP ] [ \fIlimit\fP ]
  491. XSet or display a resource limit.  The value of limit can be a number
  492. Xin the unit specified below or the value \fBunlimited\fP.
  493. XThe \fBH\fP and \fBS\fP flags specify whether the hard limit
  494. Xor the soft limit for the given resource is set.
  495. X.RS
  496. X.PD 0
  497. X.TP
  498. X\-\fBa\fP
  499. XLists all of the current resource limits.
  500. X.TP
  501. X\-\fBc\fP
  502. XThe number of 512-byte blocks on the size of core dumps.
  503. X.TP
  504. X\-\fBd\fP
  505. XThe number of K-bytes on the size of the data segment.
  506. X.TP
  507. X\-\fBf\fP
  508. XThe number of 512-byte blocks on the size of files written.
  509. X.TP
  510. X\-\fBm\fP
  511. XThe number of K-bytes on the size of physical memory.
  512. X.TP
  513. X\-\fBn\fP
  514. XThe number of file descriptors.
  515. X.TP
  516. X\-\fBs\fP
  517. XThe number of K-bytes on the size of the stack.
  518. X.TP
  519. X\-\fBt\fP
  520. XThe number of CPU seconds to be used.
  521. X.RE
  522. X.PD
  523. X.TP
  524. X\fBumask\fP [ \fImask\fP ]
  525. XThe umask is set to \fImask\fP.  \fImask\fP can be either
  526. Xan octal number or a symbolic value as described in \fBchmod\fP(1).
  527. XIf \fImask\fP is omitted, the current value is printed.
  528. X.TP
  529. X\fBunalias\fP \fIname\fP ...
  530. XThe alias definition, if any, for each \fIname\fP is removed.
  531. X.TP
  532. X\fBunfunction\fP \fIname\fP ...
  533. XThe function definition, if any, for each \fIname\fP is removed.
  534. X.TP
  535. X\fBunhash\fP \fIname\fP ...
  536. XThe entry in the command hash table, if any, for each \fIname\fP
  537. Xis removed.
  538. X.TP
  539. X\fBunlimit\fP [ \-\fBh\fP ] \fIresource\fP ...
  540. XThe resource limit for each \fIresource\fP is set to the hard limit.
  541. XIf the \-\fBh\fP flag is given and the shell is running as root,
  542. Xthe hard resource limit for each \fIresource\fP is removed.
  543. X.TP
  544. X\fBunset\fP \fIname\fP ...
  545. XEach named parameter is unset.
  546. X.TP
  547. X\fBunsetopt\fP [ \(+-\fIoptions\fP ] [ \fIname\fP ... ]
  548. XUnset the options for the shell.  All options specified either
  549. Xwith flags or by name are unset.
  550. X.TP
  551. X\fBvared\fP \fIname\fP
  552. XThe value of the parameter \fIname\fP is loaded into the edit
  553. Xbuffer, and the line editor is invoked.  When the editor exits,
  554. X\fIname\fP is set to the string value returned by the editor.
  555. X.TP
  556. X\fBwait\fP [ \fIjob\fP ... ]
  557. XWait for the specified jobs or processes.  If \fIjob\fP is not given
  558. Xthen all currently active child processes are waited for.
  559. XEach \fIjob\fP can be either a job specification or the process-id
  560. Xof a job in the job table.
  561. XThe exit status from this command is that of the job waited for.
  562. X.TP
  563. X\fBwhence\fP [ \-\fBacpv\fP ] \fIname\fP ...
  564. XFor each name, indicate how it would be interpreted if used
  565. Xas a command name.  The \-\fBv\fP flag produces a more verbose
  566. Xreport.  The \-\fBp\fP flag does a path search for \fIname\fP
  567. Xeven if it is a shell function, alias, or reserved word.
  568. XThe \-\fBc\fP flag prints the results in a csh-like format.
  569. XThe \-\fBa\fP flag does a search for all occurences of \fIname\fP
  570. Xthroughout the command path.
  571. X.TP
  572. X\fBwhich\fP
  573. XSame as \fBwhence \-c\fP.
  574. X.RE
  575. X.SH INVOCATION
  576. XCommands are first read from /etc/zshenv.
  577. XThen, if the \fBNO_RCS\fP option is unset, commands are read
  578. Xfrom $ZDOTDIR/.zshenv.
  579. X(If \fBZDOTDIR\fP is unset, \fBHOME\fP is used instead).
  580. XThen, if the shell is interactive and
  581. Xthe \fBNO_RCS\fP option is unset, commands are read
  582. Xfrom /etc/zshrc and $ZDOTDIR/.zshrc, in that order, if either file
  583. Xexists.
  584. XIf the first character of argument zero passed to the shell
  585. Xis \-, then the shell is assumed to be a login shell, and commands
  586. Xare read from /etc/zprofile and $ZDOTDIR/.zprofile before .zshrc is read,
  587. Xthen /etc/zlogin and $ZDOTDIR/.zlogin after .zshrc is read.
  588. XIf the \fBNO_RCS\fP option is set, only /etc/zshrc
  589. X/etc/zlogin, and /etc/zprofile may be read.
  590. XIf the \-\fBs\fP flag is not present and an argument is given,
  591. Xthe first argument is taken to be the pathname of a script to
  592. Xexecute.  The remaining arguments are assigned to the positional
  593. Xparameters.  The following flags are interpreted by the shell
  594. Xwhen invoked:
  595. X.TP
  596. X.PD 0
  597. X\-\fBc\fP \fIstring\fP
  598. XRead commands from \fIstring\fP.
  599. X.TP
  600. X\-\fBs\fP
  601. XRead command from the standard input.
  602. X.TP
  603. X\-\fBi\fP
  604. XIf this flag is present or the shell input and output
  605. Xare attached to a terminal, this shell is interactive.
  606. X.PD
  607. X.SH "SEE ALSO"
  608. Xsh(1),
  609. Xcsh(1),
  610. Xtcsh(1),
  611. Xitcsh(1),
  612. Xrc(1),
  613. Xbash(1),
  614. Xash(1),
  615. Xksh(1),
  616. Xclam(1),
  617. Xstrftime(3).
  618. X.SH FILES
  619. X$ZDOTDIR/.zshenv
  620. X.br
  621. X$ZDOTDIR/.zshrc
  622. X.br
  623. X$ZDOTDIR/.zlogin
  624. X.br
  625. X$ZDOTDIR/.zlogout
  626. X.br
  627. X$ZDOTDIR/.zprofile
  628. X.br
  629. X/tmp/zsh*
  630. X.br
  631. X/etc/zshenv
  632. X.br
  633. X/etc/zprofile
  634. X.br
  635. X/etc/zshrc
  636. X.br
  637. X/etc/zlogin
  638. X.SH AUTHOR
  639. XPaul Falstad (pfalstad@phoenix.princeton.edu)
  640. X.SH "UNDOCUMENTED FEATURES"
  641. XNone known, but many suspected.
  642. XPlease mail the author if you find any.
  643. SHAR_EOF
  644. echo 'File zsh2.2/man/man1/zsh.1 is complete' &&
  645. chmod 0644 zsh2.2/man/man1/zsh.1 ||
  646. echo 'restore of zsh2.2/man/man1/zsh.1 failed'
  647. Wc_c="`wc -c < 'zsh2.2/man/man1/zsh.1'`"
  648. test 112852 -eq "$Wc_c" ||
  649.     echo 'zsh2.2/man/man1/zsh.1: original size 112852, current size' "$Wc_c"
  650. rm -f _shar_wnt_.tmp
  651. fi
  652. # ============= zsh2.2/scripts/aproto ==============
  653. if test ! -d 'zsh2.2/scripts'; then
  654.     echo 'x - creating directory zsh2.2/scripts'
  655.     mkdir 'zsh2.2/scripts'
  656. fi
  657. if test -f 'zsh2.2/scripts/aproto' -a X"$1" != X"-c"; then
  658.     echo 'x - skipping zsh2.2/scripts/aproto (File already exists)'
  659.     rm -f _shar_wnt_.tmp
  660. else
  661. > _shar_wnt_.tmp
  662. echo 'x - extracting zsh2.2/scripts/aproto (Text)'
  663. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/scripts/aproto' &&
  664. X#! /bin/sh
  665. Xfproto builtin.c >builtin.pro
  666. Xfproto cond.c >cond.pro
  667. Xfproto exec.c >exec.pro
  668. Xfproto glob.c >glob.pro
  669. Xfproto hist.c >hist.pro
  670. Xfproto init.c >init.pro
  671. Xfproto jobs.c >jobs.pro
  672. Xfproto lex.c >lex.pro
  673. Xfproto loop.c >loop.pro
  674. Xfproto math.c >math.pro
  675. Xfproto mem.c >mem.pro
  676. Xfproto params.c >params.pro
  677. Xfproto subst.c >subst.pro
  678. Xfproto table.c >table.pro
  679. Xfproto text.c >text.pro
  680. Xfproto utils.c >utils.pro
  681. Xfproto watch.c >watch.pro
  682. Xfproto parse.c >parse.pro
  683. Xfproto zle_hist.c >zle_hist.pro
  684. Xfproto zle_main.c >zle_main.pro
  685. Xfproto zle_misc.c >zle_misc.pro
  686. Xfproto zle_move.c >zle_move.pro
  687. Xfproto zle_refresh.c >zle_refresh.pro
  688. Xfproto zle_tricky.c >zle_tricky.pro
  689. Xfproto zle_utils.c >zle_utils.pro
  690. Xfproto zle_vi.c >zle_vi.pro
  691. Xfproto zle_word.c >zle_word.pro
  692. SHAR_EOF
  693. chmod 0755 zsh2.2/scripts/aproto ||
  694. echo 'restore of zsh2.2/scripts/aproto failed'
  695. Wc_c="`wc -c < 'zsh2.2/scripts/aproto'`"
  696. test 755 -eq "$Wc_c" ||
  697.     echo 'zsh2.2/scripts/aproto: original size 755, current size' "$Wc_c"
  698. rm -f _shar_wnt_.tmp
  699. fi
  700. # ============= zsh2.2/scripts/fproto ==============
  701. if test -f 'zsh2.2/scripts/fproto' -a X"$1" != X"-c"; then
  702.     echo 'x - skipping zsh2.2/scripts/fproto (File already exists)'
  703.     rm -f _shar_wnt_.tmp
  704. else
  705. > _shar_wnt_.tmp
  706. echo 'x - extracting zsh2.2/scripts/fproto (Text)'
  707. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/scripts/fproto' &&
  708. X#! /bin/sh
  709. X# prototype generator
  710. Xsed -n '/\/\*\*\/$/{N;s/^\([^(]*\).*\/\*\*\/.\(.*\)/\1 DCLPROTO((\2))/p;}' $1 | sed -e 's/;/,/g' -e 's/,))$/));/' -e 's/(({))$/((void));/'
  711. X
  712. SHAR_EOF
  713. chmod 0755 zsh2.2/scripts/fproto ||
  714. echo 'restore of zsh2.2/scripts/fproto failed'
  715. Wc_c="`wc -c < 'zsh2.2/scripts/fproto'`"
  716. test 173 -eq "$Wc_c" ||
  717.     echo 'zsh2.2/scripts/fproto: original size 173, current size' "$Wc_c"
  718. rm -f _shar_wnt_.tmp
  719. fi
  720. # ============= zsh2.2/scripts/ctoz ==============
  721. if test -f 'zsh2.2/scripts/ctoz' -a X"$1" != X"-c"; then
  722.     echo 'x - skipping zsh2.2/scripts/ctoz (File already exists)'
  723.     rm -f _shar_wnt_.tmp
  724. else
  725. > _shar_wnt_.tmp
  726. echo 'x - extracting zsh2.2/scripts/ctoz (Text)'
  727. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/scripts/ctoz' &&
  728. X#! /bin/sh
  729. X#
  730. X# ctoz - alias conversion tool
  731. X# This file is part of zsh, the Z shell.
  732. X# (c) 1991 Paul Falstad
  733. X#
  734. X# This is a quick script to convert csh aliases to zsh aliases/functions.
  735. X# Pipe the output of csh's alias command through this; it will generate
  736. X# a series of alias/function definitions on stdout, suitable for
  737. X# processing by zsh (probably also ksh or bash).
  738. X#
  739. X# This is not perfect, but it gets most common aliases; it should manage to
  740. X# cut down a lot of the busy work.
  741. X#
  742. Xsed -e 's/    (\(.*\))/    \1/' >/tmp/cz$$.1
  743. Xgrep ! /tmp/cz$$.1 >/tmp/cz$$.2
  744. Xgrep -v ! /tmp/cz$$.1 >/tmp/cz$$.3
  745. Xsed -e "s/'/'"\\\\"''"/g -e 's/^\([^    ]*\)    \(.*\)$/alias \1='"'\2'/" \
  746. X    /tmp/cz$$.3
  747. Xsed -e 's/![:#]*/$/g' -e 's/^\([^    ]*\)    \(.*\)$/\1 () { \2 }/' /tmp/cz$$.2
  748. Xrm /tmp/cz$$.?
  749. X#
  750. X# in case your mailer eats tabs, here it is again, with the tabs
  751. X# marked with a T:
  752. X#
  753. X#sed -e 's/T(\(.*\))/T\1/' >/tmp/cz$$.1
  754. X#grep ! /tmp/cz$$.1 >/tmp/cz$$.2
  755. X#grep -v ! /tmp/cz$$.1 >/tmp/cz$$.3
  756. X#sed -e "s/'/'"\\\\"''"/g -e 's/^\([^T]*\)T\(.*\)$/alias \1='"'\2'/" \
  757. X#    /tmp/cz$$.3
  758. X#sed -e 's/![:#]*/$/g' -e 's/^\([^T]*\)T\(.*\)$/\1 () { \2 }/' /tmp/cz$$.2
  759. X#rm /tmp/cz$$.?
  760. SHAR_EOF
  761. chmod 0644 zsh2.2/scripts/ctoz ||
  762. echo 'restore of zsh2.2/scripts/ctoz failed'
  763. Wc_c="`wc -c < 'zsh2.2/scripts/ctoz'`"
  764. test 1137 -eq "$Wc_c" ||
  765.     echo 'zsh2.2/scripts/ctoz: original size 1137, current size' "$Wc_c"
  766. rm -f _shar_wnt_.tmp
  767. fi
  768. # ============= zsh2.2/scripts/fooz ==============
  769. if test -f 'zsh2.2/scripts/fooz' -a X"$1" != X"-c"; then
  770.     echo 'x - skipping zsh2.2/scripts/fooz (File already exists)'
  771.     rm -f _shar_wnt_.tmp
  772. else
  773. > _shar_wnt_.tmp
  774. echo 'x - extracting zsh2.2/scripts/fooz (Text)'
  775. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/scripts/fooz' &&
  776. Xalias -- 0='vi'
  777. Xalias -- a='alias'
  778. Xalias -- a.out='./a.out'
  779. Xalias -- c='cp'
  780. Xalias -- gnu='telnet gnu.ai.mit.edu'
  781. Xalias -- grep='egrep'
  782. Xalias -- gz='gdb zsh'
  783. Xalias -- j='jobs -l'
  784. Xalias -- k='kill'
  785. Xalias -- l='ls -AF'
  786. Xalias -- lock='lock -p -600'
  787. Xalias -- lsd='ls -d */'
  788. Xalias -- m='make'
  789. Xalias -- main='./main'
  790. Xalias -- man='woman'
  791. Xalias -- mm='less'
  792. Xalias -- more='less'
  793. Xalias -- nw='l -ltr | tail'
  794. Xalias -- pd='pushd'
  795. Xalias -- pop='popd'
  796. Xalias -- ps='sps'
  797. Xalias -- pwrite='talk'
  798. Xalias -- rn='h /usr/princeton/bin/rn.4.1'
  799. Xalias -- rtfm='man'
  800. Xalias -- strings='strings -'
  801. Xalias -- t='cat'
  802. Xalias -- talk='h talk'
  803. Xalias -- v='mv'
  804. Xalias -- where='hostname; echo >/dev/null'
  805. Xalias -- whm='who | mm'
  806. Xalias -- wm='w | mm'
  807. X320 () { $* | fgrep -f /u/pfalstad/src/cs320/cs320list }
  808. Xacx () { chmod 755 $* }
  809. Xcx () { chmod +x $* }
  810. Xf () { $* | fgrep -f /u/pfalstad/.friends }
  811. Xk9 () { kill -9 $* }
  812. Xmere () { nroff <$1 -man -Tman | less -s }
  813. Xnrable () { ls -AFltr $* | grep -v r..r..  }
  814. Xrable () { ls -AFltr $* | grep r..r..  }
  815. Xexport ATTRIBUTION='%f wrote:'
  816. Xexport CAD_HOME='/u/cad/magic'
  817. Xexport COSMOS='/u/cad/cosmos'
  818. Xexport HOME='/u/pfalstad'
  819. Xexport LESS='-ainx3'
  820. Xexport LM_LICENSE_FILE='/u/cs475/Mentor/etc/license_file'
  821. Xexport LOGNAME='pfalstad'
  822. Xexport MAIL='/usr/spool/mail/pfalstad'
  823. Xexport MAILCALL='NEW MAIL! '
  824. Xexport MANPATH='/usr/man:/usr/princeton/man:/u/cad/man'
  825. Xexport NAME='Paul Falstad'
  826. Xexport OCTTOOLS='/u/cad/octtools'
  827. Xexport ORGANIZATION='The E. Henry Thripshaw Fan Club'
  828. Xexport PATH='/u/pfalstad/scr:/u/pfalstad/bin/sun4:/usr/princeton/bin:/usr/ucb:/usr/bin:/bin:/u/maruchck/scr:/u/cs320/bin:/u/subbarao/bin:/u/maruchck/bin:/usr/hosts:/usr/princeton/bin/X11:/usr/etc:/etc'
  829. Xexport PRINTER='dod'
  830. Xexport PWD='/n/homeserver/c/pfalstad/zsh2.1/scripts'
  831. Xexport RNINIT='/u/pfalstad/.rninit'
  832. Xexport SCS='/u/cs475/Mentor'
  833. Xexport SCS_LICENSE_CLASS='2'
  834. Xexport SHELL='/u/pfalstad/bin/sun4/zsh'
  835. Xexport TERM='vt100'
  836. Xexport TERMCAP='d0|vt100|vt100-am|vt100am|dec-vt100:do=^J:co#80:li#24:cl=50\E[;H\E[2J:sf=5\ED:le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E>\E[?1l\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:rf=/usr/share/lib/tabset/vt100:rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:xn:sc=\E7:rc=\E8:cs=\E[%i%d;%dr:'
  837. Xexport USER='pfalstad'
  838. Xexport YOUSAID='In %C you wrote:'
  839. Xexport _='/u/pfalstad/zsh2.1/scripts/c2z'
  840. XDISPLAY='phoenix:0.0'
  841. XHOSTTYPE='sun4'
  842. Xcdpath=(/u/pfalstad /u/pfalstad/src/cs320 /u/pfalstad/src)
  843. Xedit=
  844. XHISTSIZE='200'
  845. XHOME='/u/pfalstad'
  846. Xmail=(30 /usr/spool/mail/pfalstad)
  847. Xpath=(/u/pfalstad/scr /u/pfalstad/bin/sun4 /usr/princeton/bin /usr/ucb /usr/bin /bin /u/maruchck/scr /u/cs320/bin /u/subbarao/bin /u/maruchck/bin /usr/hosts /usr/princeton/bin/X11 /usr/etc /etc)
  848. Xprompt='c phoenix% '
  849. Xshell='/bin/csh'
  850. Xsetopt globdots
  851. Xterm='vt100'
  852. Xuser='pfalstad'
  853. Xvi=
  854. SHAR_EOF
  855. chmod 0644 zsh2.2/scripts/fooz ||
  856. echo 'restore of zsh2.2/scripts/fooz failed'
  857. Wc_c="`wc -c < 'zsh2.2/scripts/fooz'`"
  858. test 2958 -eq "$Wc_c" ||
  859.     echo 'zsh2.2/scripts/fooz: original size 2958, current size' "$Wc_c"
  860. rm -f _shar_wnt_.tmp
  861. fi
  862. # ============= zsh2.2/scripts/c2z ==============
  863. if test -f 'zsh2.2/scripts/c2z' -a X"$1" != X"-c"; then
  864.     echo 'x - skipping zsh2.2/scripts/c2z (File already exists)'
  865.     rm -f _shar_wnt_.tmp
  866. else
  867. > _shar_wnt_.tmp
  868. echo 'x - extracting zsh2.2/scripts/c2z (Text)'
  869. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/scripts/c2z' &&
  870. X#! /bin/sh
  871. X#
  872. X# c2z - environment conversion tool
  873. X# Contributed by Bart Schaefer
  874. X# (Tweaked a bit by Paul Falstad)
  875. X#
  876. X# This is a quick script to convert csh aliases to zsh aliases/functions.
  877. X# It also converts the csh environment and local variables to zsh.  c2z
  878. X# uses the csh to parse its own dot-files, then processes csh output to
  879. X# convert the csh settings to zsh.
  880. X#
  881. X# When run as a zsh fuction, c2z runs csh as if it were an interactive
  882. X# shell whenever the parent zsh is interactive.  When run as a shell
  883. X# script, the -i switch can be used to force this behavior.
  884. X#
  885. X# The -l (login) switch causes csh to run as if it were a login shell.
  886. X# This is done "properly" if c2z is used as a zsh function, otherwise
  887. X# it's faked by explicitly sourcing .login.  Use with caution if your
  888. X# .login initializes an X server or does other one-time-only startup
  889. X# procedures.
  890. X#
  891. X# usage:
  892. X#    c2z [-i] [-l]
  893. X#
  894. X# You can use this script in your .zshrc or .zlogin files to load your
  895. X# regular csh environment into zsh; for example, in .zlogin:
  896. X#
  897. X#    . =(c2z -l)
  898. X#
  899. X# This is not perfect, but it gets most common aliases and variables.
  900. X# It's also rather time-consuming to do this every time you log in.
  901. X# However, if you're moving from csh to zsh for the first time, this
  902. X# can get you started with a familiar environment right away.
  903. X#
  904. X# In case your mailer eats tabs, $T is set to expand to a tab.
  905. X#
  906. XT="`echo x | tr x '\011'`"
  907. X
  908. X# If we're zsh, we can run "- csh" to get the complete environment.
  909. X#
  910. XMINUS=""
  911. XLOGIN=""
  912. XINTERACT=""
  913. Xcase "$VERSION" in
  914. Xzsh*)
  915. X    case $1 in
  916. X    -l*) MINUS="-" ;;
  917. X    -i*) INTERACT="-i" ;;
  918. X    esac
  919. X    if [[ -o INTERACTIVE ]]; then INTERACT="-i"; fi
  920. X    setopt nobanghist
  921. X    ;;
  922. X*)
  923. X    case $1 in
  924. X    -l*) LOGIN="source ~/.login" ;;
  925. X    -i*) INTERACT="-i" ;;
  926. X    esac
  927. X    ;;
  928. Xesac
  929. X
  930. X( eval $MINUS csh $INTERACT ) <<EOF 2>&1 >/dev/null
  931. X$LOGIN
  932. Xalias >! /tmp/cz$$.a
  933. Xsetenv >! /tmp/cz$$.e
  934. Xset >! /tmp/cz$$.v
  935. XEOF
  936. X
  937. X# save stdin
  938. Xexec 9<&0
  939. X
  940. X# First convert aliases
  941. Xexec < /tmp/cz$$.a
  942. X
  943. X# Taken straight from ctoz except for $T and "alias --"
  944. Xsed -e 's/'"$T"'(\(.*\))/'"$T"'\1/' >/tmp/cz$$.1
  945. Xgrep ! /tmp/cz$$.1 >/tmp/cz$$.2
  946. Xgrep -v ! /tmp/cz$$.1 >/tmp/cz$$.3
  947. Xsed -e "s/'/'"\\\\"''"/g \
  948. X    -e 's/^\([^'"$T"']*\)'"$T"'\(.*\)$/alias -- \1='"'\2'/" \
  949. X    /tmp/cz$$.3
  950. Xsed -e 's/![:#]*/$/g' \
  951. X    -e 's/^\([^'"$T"']*\)'"$T"'\(.*\)$/\1 () { \2 }/' \
  952. X    /tmp/cz$$.2
  953. X
  954. X# Next, convert environment variables
  955. Xexec < /tmp/cz$$.e
  956. X
  957. X# Would be nice to deal with embedded newlines, e.g. in TERMCAP, but ...
  958. Xsed -e '/^SHLVL/d' \
  959. X    -e "s/'/'"\\\\"''"/g \
  960. X    -e "s/^\([A-Za-z0-9_]*=\)/export \1'/" \
  961. X    -e "s/$/'/"
  962. X
  963. X# Finally, convert local variables
  964. Xexec < /tmp/cz$$.v
  965. X
  966. Xsed -e 's/'"$T"'/=/' \
  967. X    -e "s/'/'"\\\\"''"/g \
  968. X    -e '/^[A-Za-z0-9_]*=[^(]/{
  969. X    s/=/='"'/"'
  970. X    s/$/'"'/"'
  971. X    }' |
  972. Xsed -e '/^argv=/d' -e '/^cwd=/d' -e '/^filec=/d' -e '/^status=/d' \
  973. X     -e '/^histchars=/s//HISTCHARS=/' \
  974. X     -e '/^history=/s//HISTSIZE=/' \
  975. X     -e '/^home=/s//HOME=/' \
  976. X     -e '/^ignoreeof=/s/.*/setopt ignoreeof/' \
  977. X     -e '/^noclobber=/s/.*/setopt noclobber/' \
  978. X     -e '/^notify=/d' \
  979. X     -e '/^showdots=/s/.*/setopt globdots/' \
  980. X    -e '/^savehist=/s//HISTFILE=\~\/.zhistory SAVEHIST=/' \
  981. X     -e '/^autolist=/s/.*/setopt autolist/' \
  982. X     -e '/^correct=[cmd]*/s//setopt autocorrect/' \
  983. X     -e '/^who=/s//WATCHFMT=/'
  984. X
  985. X
  986. Xexec 0<&9
  987. X
  988. Xrm /tmp/cz$$.?
  989. Xexit
  990. SHAR_EOF
  991. chmod 0755 zsh2.2/scripts/c2z ||
  992. echo 'restore of zsh2.2/scripts/c2z failed'
  993. Wc_c="`wc -c < 'zsh2.2/scripts/c2z'`"
  994. test 3299 -eq "$Wc_c" ||
  995.     echo 'zsh2.2/scripts/c2z: original size 3299, current size' "$Wc_c"
  996. rm -f _shar_wnt_.tmp
  997. fi
  998. # ============= zsh2.2/scripts/c2z.orig ==============
  999. if test -f 'zsh2.2/scripts/c2z.orig' -a X"$1" != X"-c"; then
  1000.     echo 'x - skipping zsh2.2/scripts/c2z.orig (File already exists)'
  1001.     rm -f _shar_wnt_.tmp
  1002. else
  1003. > _shar_wnt_.tmp
  1004. echo 'x - extracting zsh2.2/scripts/c2z.orig (Text)'
  1005. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/scripts/c2z.orig' &&
  1006. X#! /bin/sh
  1007. X#
  1008. X# c2z - environment conversion tool
  1009. X# Contributed by Bart Schaefer
  1010. X#
  1011. X# This is a quick script to convert csh aliases to zsh aliases/functions.
  1012. X# It also converts the csh environment and local variables to zsh.  c2z
  1013. X# uses the csh to parse its own dot-files, then processes csh output to
  1014. X# convert the csh settings to zsh.
  1015. X#
  1016. X# When run as a zsh fuction, c2z runs csh as if it were an interactive
  1017. X# shell whenever the parent zsh is interactive.  When run as a shell
  1018. X# script, the -i switch can be used to force this behavior.
  1019. X#
  1020. X# The -l (login) switch causes csh to run as if it were a login shell.
  1021. X# This is done "properly" if c2z is used as a zsh function, otherwise
  1022. X# it's faked by explicitly sourcing .login.  Use with caution if your
  1023. X# .login initializes an X server or does other one-time-only startup
  1024. X# procedures.
  1025. X#
  1026. X# usage:
  1027. X#    c2z [-i] [-l]
  1028. X#
  1029. X# You can use this script in your .zshrc or .zlogin files to load your
  1030. X# regular csh environment into zsh; for example, in .zlogin:
  1031. X#
  1032. X#    . =(c2z -l)
  1033. X#
  1034. X# This is not perfect, but it gets most common aliases and variables.
  1035. X# It's also rather time-consuming to do this every time you log in.
  1036. X# However, if you're moving from csh to zsh for the first time, this
  1037. X# can get you started with a familiar environment right away.
  1038. X#
  1039. X# In case your mailer eats tabs, $T is set to expand to a tab.
  1040. X#
  1041. XT="`echo x | tr x '\011'`"
  1042. X
  1043. X# If we're zsh, we can run "- csh" to get the complete environment.
  1044. X#
  1045. XMINUS=""
  1046. XLOGIN=""
  1047. XINTERACT=""
  1048. Xcase "$VERSION" in
  1049. Xzsh*)
  1050. X    case $1 in
  1051. X    -l*) MINUS="-" ;;
  1052. X    -i*) INTERACT="-i" ;;
  1053. X    esac
  1054. X    if [[ -o INTERACTIVE ]]; then INTERACT="-i"; fi
  1055. X    setopt nobanghist
  1056. X    ;;
  1057. X*)
  1058. X    case $1 in
  1059. X    -l*) LOGIN="source ~/.login" ;;
  1060. X    -i*) INTERACT="-i" ;;
  1061. X    esac
  1062. X    ;;
  1063. Xesac
  1064. X
  1065. X( eval $MINUS csh $INTERACT ) <<EOF 2>&1 >/dev/null
  1066. X$LOGIN
  1067. Xalias >! /tmp/cz$$.a
  1068. Xsetenv >! /tmp/cz$$.e
  1069. Xset >! /tmp/cz$$.v
  1070. XEOF
  1071. X
  1072. X# First convert aliases
  1073. Xexec < /tmp/cz$$.a
  1074. X
  1075. X# Taken straight from ctoz except for $T and "alias --"
  1076. Xsed -e 's/'"$T"'(\(.*\))/'"$T"'\1/' >/tmp/cz$$.1
  1077. Xgrep ! /tmp/cz$$.1 >/tmp/cz$$.2
  1078. Xgrep -v ! /tmp/cz$$.1 >/tmp/cz$$.3
  1079. Xsed -e "s/'/'"\\\\"''"/g \
  1080. X    -e 's/^\([^'"$T"']*\)'"$T"'\(.*\)$/alias -- \1='"'\2'/" \
  1081. X    /tmp/cz$$.3
  1082. Xsed -e 's/![:#]*/$/g' \
  1083. X    -e 's/^\([^'"$T"']*\)'"$T"'\(.*\)$/\1 () { \2 }/' \
  1084. X    /tmp/cz$$.2
  1085. X
  1086. X# Next, convert environment variables
  1087. Xexec < /tmp/cz$$.e
  1088. X
  1089. X# Would be nice to deal with embedded newlines, e.g. in TERMCAP, but ...
  1090. Xsed -e '/^SHLVL/d' \
  1091. X    -e "s/'/'"\\\\"''"/g \
  1092. X    -e "s/^\([A-Za-z0-9_]*=\)/export \1'/" \
  1093. X    -e "s/$/'/"
  1094. X
  1095. X# Finally, convert local variables
  1096. Xsed -e '
  1097. Xexec < /tmp/cz$$.v
  1098. X
  1099. Xsed -e 's/'"$T"'/=/' \
  1100. X    -e "s/'/'"\\\\"''"/g \
  1101. X    -e '/^[A-Za-z0-9_]*=[^(]/{
  1102. X    s/=/='"'/"'
  1103. X    s/$/'"'/"'
  1104. X    }'
  1105. X
  1106. Xrm /tmp/cz$$.?
  1107. Xexit
  1108. SHAR_EOF
  1109. chmod 0755 zsh2.2/scripts/c2z.orig ||
  1110. echo 'restore of zsh2.2/scripts/c2z.orig failed'
  1111. Wc_c="`wc -c < 'zsh2.2/scripts/c2z.orig'`"
  1112. test 2736 -eq "$Wc_c" ||
  1113.     echo 'zsh2.2/scripts/c2z.orig: original size 2736, current size' "$Wc_c"
  1114. rm -f _shar_wnt_.tmp
  1115. fi
  1116. # ============= zsh2.2/src/buildzsh ==============
  1117. if test ! -d 'zsh2.2/src'; then
  1118.     echo 'x - creating directory zsh2.2/src'
  1119.     mkdir 'zsh2.2/src'
  1120. fi
  1121. if test -f 'zsh2.2/src/buildzsh' -a X"$1" != X"-c"; then
  1122.     echo 'x - skipping zsh2.2/src/buildzsh (File already exists)'
  1123.     rm -f _shar_wnt_.tmp
  1124. else
  1125. > _shar_wnt_.tmp
  1126. echo 'x - extracting zsh2.2/src/buildzsh (Text)'
  1127. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/src/buildzsh' &&
  1128. X#! /bin/sh
  1129. Xecho
  1130. Xecho 'Building config.h...
  1131. X'
  1132. Xexec >config.h
  1133. Xcat <<'foo'
  1134. X/* this file is created automatically by buildzsh */
  1135. X
  1136. X/* define this if you are sysvish */
  1137. Xfoo
  1138. Xif test -f /usr/include/sys/resource.h
  1139. Xthen echo '/* #define SYSV */'; echo 'looks like a BSDish system...' >&2
  1140. Xelse echo '#define SYSV'; echo 'looks like a SYSVish system...' >&2
  1141. Xfi
  1142. Xecho
  1143. Xif grep ULTRIX /usr/include/stdio.h >/dev/null 2>&1
  1144. Xthen echo '/* ULTRIX termios is weird... */
  1145. X/* #define TERMIOS */'; echo 'using sgttyb...' >&2
  1146. Xelse
  1147. Xif test -f /usr/include/termios.h && test ! -f /hp-ux
  1148. Xthen echo '#define TERMIOS
  1149. X/* #define TTY_NEEDS_DRAINING */
  1150. X/* #define CLOBBERS_TYPEAHEAD */'
  1151. Xecho 'using termios...' >&2
  1152. Xelse
  1153. Xif grep sgttyb /usr/include/sys/ioctl.h >/dev/null 2>&1
  1154. Xthen echo '/* #define TERMIO */'
  1155. Xelse echo '#define TERMIO'
  1156. Xecho 'using termio...' >&2
  1157. Xfi
  1158. Xecho '#define TTY_NEEDS_DRAINING
  1159. X#define CLOBBERS_TYPEAHEAD'
  1160. Xecho 'using sgttyb...' >&2
  1161. Xfi
  1162. Xfi
  1163. Xecho
  1164. Xif test -f /usr/include/stdlib.h
  1165. Xthen echo '#define HAS_STDLIB'; echo 'using <stdlib.h>...' >&2
  1166. Xelse echo '/*#define HAS_STDLIB*/'; echo 'not using <stdlib.h>...' >&2
  1167. Xfi
  1168. Xecho
  1169. Xif test -f /usr/include/string.h
  1170. Xthen echo '#define HAS_STRING'; echo 'using <string.h>...' >&2
  1171. Xelse echo '/*#define HAS_STRING*/'; echo 'using <strings.h>...' >&2
  1172. Xecho '#define strchr    index
  1173. X#define strrchr    rindex
  1174. X#define memcpy(dst, src, n)    bcopy(src, dst, n)
  1175. X#define memset(dst, ch, n)    bfill(dst, n, ch)
  1176. X#define memcmp(s1, s2, n)    bcopy(s1, s2, n)'
  1177. Xfi
  1178. Xecho
  1179. Xif test -f /usr/include/locale.h
  1180. Xthen echo '#define HAS_LOCALE'; echo 'using <locale.h>...' >&2
  1181. Xelse echo '/*#define HAS_LOCALE*/'; echo 'not using <locale.h>...' >&2
  1182. Xfi
  1183. Xecho
  1184. Xecho '/* define this if you have a host field in utmp */'
  1185. Xif grep ut_host /usr/include/utmp.h >/dev/null
  1186. Xthen echo '#define UTMP_HOST'; echo 'host field in utmp...' >&2
  1187. Xelse echo '/* #define UTMP_HOST */'; echo 'no host field in utmp...' >&2
  1188. Xfi
  1189. Xecho
  1190. Xecho '/* define this if you have WAITPID */'
  1191. Xif man 2 wait 2>/dev/null | sed 's/_.//g' | grep waitpid >/dev/null
  1192. Xthen echo '#define WAITPID'; echo 'using waitpid()...' >&2
  1193. Xelse echo '/* #define WAITPID */'; echo 'not using waitpid()...' >&2
  1194. Xfi
  1195. Xecho
  1196. Xecho '/* define this if you have SELECT */'
  1197. Xif grep FD_SET /usr/include/sys/types.h >/dev/null ||
  1198. X    test -f /usr/include/sys/select.h
  1199. Xthen echo '#define HAS_SELECT'; echo 'using select()...' >&2
  1200. Xelse echo '/* #define HAS_SELECT */'; echo 'not using select()...' >&2
  1201. Xfi
  1202. Xecho
  1203. Xecho '/* define this if you have <sys/select.h> */'
  1204. Xif test -f /usr/include/sys/select.h
  1205. Xthen echo '#define HAS_SYS_SELECT'
  1206. Xelse echo '/* #define HAS_SYS_SELECT */'
  1207. Xfi
  1208. Xecho "
  1209. X/* we can't just test for S_IFIFO or check to see if the mknod worked,
  1210. X   because the NeXTs sold by a vendor which will remain nameless will
  1211. X   happily create the FIFO for you, and then panic when you try to do
  1212. X    something weird with them, because they aren't supported by the OS. */
  1213. X"
  1214. Xif test -f /mach
  1215. Xthen echo '#define NO_FIFOS'; echo 'no FIFOs...' >&2
  1216. Xelse echo '/* #define NO_FIFOS */'; echo 'using FIFOs...' >&2
  1217. Xfi
  1218. Xecho
  1219. Xecho '/* define this if you have strftime() */'
  1220. Xif man 3 strftime 2>/dev/null | grep return >/dev/null
  1221. Xthen echo '#define HAS_STRFTIME'; echo 'using strftime()...' >&2
  1222. Xelse echo '/* #define HAS_STRFTIME */'; echo 'not using strftime()...' >&2
  1223. Xfi
  1224. Xecho
  1225. Xif man tcsetpgrp 2>/dev/null | grep process >/dev/null
  1226. Xthen echo '#define HAS_TCSETPGRP'; echo 'using tcsetpgrp()...' >&2
  1227. Xelse echo '/* #define HAS_TCSETPGRP */'; echo 'not using tcsetpgrp()...' >&2
  1228. Xfi
  1229. Xecho
  1230. Xif grep tcgetattr /usr/include/termios.h >/dev/null 2>/dev/null ||
  1231. X    grep tcgetattr /usr/include/sys/termios.h >/dev/null 2>/dev/null ||
  1232. X    grep tcgetattr /usr/include/sys/termio.h >/dev/null 2>/dev/null
  1233. Xthen echo '#define HAS_TCCRAP'; echo 'using tcgetattr() and friends...' >&2
  1234. Xelse echo '/* #define HAS_TCCRAP */'; echo 'not using tcgetattr()...' >&2
  1235. Xfi
  1236. Xecho
  1237. Xif test -f /bin/hinv
  1238. Xthen echo '/* SGI setpgid() is weird...  setpgrp() is better anyway */
  1239. X/* #define HAS_SETPGID */'; echo 'using setpgrp()...' >&2
  1240. Xelif man setpgid 2>/dev/null | grep process >/dev/null
  1241. Xthen echo '#define HAS_SETPGID'; echo 'using setpgid()...' >&2
  1242. Xelse echo '/* #define HAS_SETPGID */'; echo 'using setpgrp()...' >&2
  1243. Xfi
  1244. Xecho
  1245. Xif test ! -f /hp-ux && man sigrelse 2>/dev/null | grep signal >/dev/null
  1246. Xthen echo '#define HAS_SIGRELSE'; echo 'using sigrelse()...' >&2
  1247. Xelse echo '/* #define HAS_SIGRELSE */'; echo 'using sigblock()...' >&2
  1248. Xfi
  1249. Xecho
  1250. Xecho '/* define this if you have RFS */'
  1251. Xif test -d /../.CONTROL
  1252. Xthen echo '#define HAS_RFS'; echo 'you seem to have RFS...' >&2
  1253. Xelse echo '/* #define HAS_RFS */'; echo 'no RFS, it seems...' >&2
  1254. Xfi
  1255. Xecho
  1256. Xecho '/* define this if you have a working getrusage and wait3 */'
  1257. Xif test -f /hp-ux
  1258. Xthen echo '/* #define HAS_RUSAGE */'; echo 'no getrusage...' >&2
  1259. Xelif test -f /usr/include/sys/resource.h
  1260. Xthen echo '#define HAS_RUSAGE'; echo 'has getrusage...' >&2
  1261. Xelse echo '/* #define HAS_RUSAGE */'; echo 'no getrusage...' >&2
  1262. Xfi
  1263. Xecho '
  1264. X/* define this if your signal handlers return void */'
  1265. Xif grep SIG_DFL /usr/include/signal.h /usr/include/sys/signal.h |
  1266. X    grep void >/dev/null
  1267. Xthen echo '#define SIGVOID'; echo 'signal handlers return void...' >&2
  1268. Xelse echo '/* #define SIGVOID */'; echo 'signal handlers return int...' >&2
  1269. Xfi
  1270. Xcat <<'foo'
  1271. X#ifdef sgi
  1272. X#undef SIGVOID
  1273. X#endif
  1274. Xfoo
  1275. Xecho
  1276. Xecho '/* define this if signal handlers need to be reset each time */'
  1277. Xif grep SIGTSTP /usr/include/signal.h /usr/include/sys/signal.h >/dev/null
  1278. Xthen echo '/* #define RESETHANDNEEDED */'
  1279. Xecho 'signal handlers need no resetting...' >&2
  1280. Xelse echo '#define RESETHANDNEEDED'
  1281. Xecho 'signal handlers need to be reset...' >&2
  1282. Xfi
  1283. Xecho
  1284. Xcat <<'foo'
  1285. X#ifdef SIGVOID
  1286. X#define HANDTYPE void
  1287. X#else
  1288. X#define HANDTYPE int
  1289. X#define INTHANDTYPE
  1290. X#endif
  1291. X
  1292. X/* a string corresponding to the host type */
  1293. Xfoo
  1294. Xecho '#define HOSTTYPE "' | tr -d '\012'
  1295. Xhost=`(tcsh -fc 'echo $HOSTTYPE' || arch) 2>/dev/null`
  1296. Xcase $host in
  1297. X'') if grep ULTRIX /usr/include/stdio.h >/dev/null 2>&1
  1298. X    then host=ultrix
  1299. X     elif test -f /bin/hinv
  1300. X     then host=iris
  1301. X     elif test -d /NextApps
  1302. X     then host=next
  1303. X     elif test $machine
  1304. X     then host=$machine
  1305. X     else
  1306. X     echo 1>&2 '
  1307. X
  1308. XI cannot figure out what sort of host this is.  Please enter one
  1309. Xshort alphanumeric string describing this host.  (This will be used
  1310. Xto set the $HOSTTYPE variable, so '"you don't have to be very
  1311. Xaccurate if you're not in a multivendor environment.)
  1312. X"
  1313. X     echo "? " | tr -d '\012' 1>&2
  1314. X     read host
  1315. X     echo ' ' 1>&2
  1316. X     fi
  1317. X  ;;
  1318. Xesac
  1319. Xecho $host'"'
  1320. Xecho "using host type $host..." >&2
  1321. Xecho
  1322. Xecho '/* the default editor for the fc builtin */'
  1323. Xecho '#define DEFFCEDIT "vi"'
  1324. Xecho
  1325. Xif grep UTMP_FILE /usr/include/utmp.h >/dev/null
  1326. Xthen :
  1327. Xelse 
  1328. Xecho '/* the path of wtmp */'
  1329. Xecho '#define WTMP_FILE "' | tr -d '\012'
  1330. Xif test -f /etc/wtmp
  1331. Xthen echo /etc/wtmp
  1332. Xelif test -f /usr/etc/wtmp
  1333. Xthen echo /usr/etc/wtmp
  1334. Xelif test -f /var/adm/wtmp
  1335. Xthen echo /var/adm/wtmp
  1336. Xelif test -f /usr/adm/wtmp
  1337. Xthen echo /usr/adm/wtmp
  1338. Xelse echo /dev/null
  1339. Xfi | tr -d '\012'
  1340. Xecho '"
  1341. X
  1342. X/* the path of utmp */
  1343. X#define UTMP_FILE "/etc/utmp"
  1344. X'
  1345. Xfi
  1346. Xcat <<'foo'
  1347. X/* default prefix for temporary files */
  1348. X#define DEFTMPPREFIX "/tmp/zsh"
  1349. X
  1350. X/* define if you prefer "suspended" to "stopped" */
  1351. X#define USE_SUSPENDED
  1352. X
  1353. X/* the file to source whenever zsh is run; if undefined, don't source
  1354. X    anything */
  1355. X#define GLOBALZSHRC "/etc/zshrc"
  1356. X
  1357. X/* the file to source whenever zsh is run as a login shell; if
  1358. X    undefined, don't source anything */
  1359. X#define GLOBALZLOGIN "/etc/zlogin"
  1360. X
  1361. X/* the file to source whenever zsh is run as a login shell, before
  1362. X    zshrc is read; if undefined, don't source anything */
  1363. X#define GLOBALZPROFILE "/etc/zprofile"
  1364. X
  1365. X/* the default HISTSIZE */
  1366. X#define DEFAULT_HISTSIZE 30
  1367. X
  1368. X#define _BSD_SIGNALS   /* this could be an iris, you never know */
  1369. X#define _BSD           /* this could be HP-UX, you never know */
  1370. X#define _BSD_INCLUDES  /* this could be AIX, you never know */
  1371. X
  1372. X/* if your compiler doesn't like void *, change this to char *
  1373. X    and ignore all the warnings.
  1374. X*/
  1375. X
  1376. Xtypedef void *vptr;
  1377. X
  1378. X#define JOB_CONTROL
  1379. Xfoo
  1380. Xexec 1>&2
  1381. Xecho
  1382. Xecho 'Building signals.h...' | tr -d '\012'
  1383. Xecho `csh -fc 'kill -l'` | tr ' ' '\012' >signals.h
  1384. Xlct=`wc -l < signals.h`
  1385. Xcp signals.h signams.h
  1386. X(
  1387. Xecho '/* this file is created automatically by buildzsh */
  1388. X/* if all this is wrong, blame csh ;-) */
  1389. X
  1390. X#define SIGCOUNT '"$lct"'
  1391. X
  1392. X#ifdef GLOBALS
  1393. X
  1394. Xchar *sigmsg[SIGCOUNT+2] = {
  1395. X    "done",'
  1396. Xsed -e 's/^/SIG/' -e '/SIGHUP/s//hangup/
  1397. X/SIGINT/s//interrupt/
  1398. X/SIGQUIT/s//quit/
  1399. X/SIGILL/s//illegal instruction/
  1400. X/SIGTRAP/s//trace trap/
  1401. X/SIGIOT/s//IOT instruction/
  1402. X/SIGABRT/s//abort/
  1403. X/SIGEMT/s//EMT instruction/
  1404. X/SIGFPE/s//floating point exception/
  1405. X/SIGKILL/s//killed/
  1406. X/SIGBUS/s//bus error/
  1407. X/SIGSEGV/s//segmentation fault/
  1408. X/SIGSYS/s//bad system call/
  1409. X/SIGPIPE/s//broken pipe/
  1410. X/SIGTERM/s//terminated/
  1411. X/SIGPWR/s//power fail/
  1412. X/SIGVTALRM/s//virtual time alarm/
  1413. X/SIGCONT/s//continued/
  1414. X/SIGXCPU/s//cpu limit exceeded/
  1415. X/SIGXFSZ/s//filesize limit exceeded/' -e 's/.*/    "&",/' signals.h
  1416. Xecho '    NULL
  1417. X};
  1418. X
  1419. Xchar *sigs[SIGCOUNT+4] = {
  1420. X    "EXIT",' ) >sigtmp.h
  1421. Xmv sigtmp.h signals.h
  1422. Xif grep SIGSTOP signals.h >/dev/null
  1423. Xthen ed signals.h <<'foo' >/dev/null 2>&1
  1424. X/SIGSTOP/c
  1425. X#ifdef USE_SUSPENDED
  1426. X    "suspended (signal)",
  1427. X#else
  1428. X    "stopped (signal)",
  1429. X#endif
  1430. X.
  1431. X/SIGTSTP/c
  1432. X#ifdef USE_SUSPENDED
  1433. X    "suspended",
  1434. X#else
  1435. X    "stopped",
  1436. X#endif
  1437. X.
  1438. X/SIGTTIN/c
  1439. X#ifdef USE_SUSPENDED
  1440. X    "suspended (tty input)",
  1441. X#else
  1442. X    "stopped (tty input)",
  1443. X#endif
  1444. X.
  1445. X/SIGTTOU/c
  1446. X#ifdef USE_SUSPENDED
  1447. X    "suspended (tty output)",
  1448. X#else
  1449. X    "stopped (tty output)",
  1450. X#endif
  1451. X.
  1452. Xw
  1453. Xq
  1454. Xfoo
  1455. Xfi
  1456. X(sed 's/.*/    "&",/' signams.h
  1457. Xecho '    "ERR",
  1458. X    "DEBUG",
  1459. X    NULL
  1460. X};
  1461. X
  1462. X#else
  1463. X
  1464. Xextern char *sigs[SIGCOUNT+4],*sigmsg[SIGCOUNT+2];
  1465. X
  1466. X#endif') >>signals.h
  1467. Xrm signams.h
  1468. Xecho done
  1469. Xecho 'Building Makefile...' | tr -d '\012'
  1470. Xexec >Makefile
  1471. Xcat <<'foo'
  1472. X#! /bin/make -f
  1473. X# Makefile for zsh
  1474. X# generated by buildzsh
  1475. X
  1476. XOBJS=builtin.o cond.o exec.o glob.o hist.o init.o jobs.o lex.o loop.o \
  1477. Xmath.o mem.o params.o parse.o subst.o table.o text.o utils.o watch.o \
  1478. Xzle_bindings.o zle_hist.o zle_main.o zle_misc.o zle_move.o zle_refresh.o \
  1479. Xzle_tricky.o zle_utils.o zle_vi.o zle_word.o
  1480. X
  1481. XBINDIR=/usr/local/bin
  1482. XMANDIR=/usr/local/man/man1
  1483. X
  1484. X# debugging flags
  1485. X#CFLAGS=-g -Wreturn-type -Wunused -Wpointer-arith -DQDEBUG
  1486. X#CC=gcc -traditional
  1487. X
  1488. XCC=cc
  1489. Xfoo
  1490. Xif test -f /usr/include/ndir.h -a ! -f /usr/lib/libBSD.a
  1491. Xthen echo 'CFLAGS= -O -Aa'
  1492. Xelif strings /usr/bin/cc 2>/dev/null | grep cckr >/dev/null 2>&1
  1493. Xthen echo 'CFLAGS= -O -cckr'
  1494. Xelse echo 'CFLAGS= -O'
  1495. Xfi
  1496. Xif test -f /bin/hinv
  1497. Xthen
  1498. Xif grep '^\+' /etc/passwd >/dev/null
  1499. Xthen echo 'LIBS= -lcurses -lmalloc -lbsd -lsun'
  1500. Xelse echo 'LIBS= -lcurses -lmalloc -lbsd'
  1501. Xfi
  1502. Xelif test -f /usr/lib/libcposix.a
  1503. Xthen echo 'LIBS= -lcposix -ltermcap'
  1504. Xelif test -f /usr/lib/libBSD.a
  1505. Xthen echo 'LIBS= -ltermcap -lBSD'
  1506. Xelif test -f /usr/lib/libtermcap.a || test -f /usr/ucblib/libtermcap.a
  1507. Xthen
  1508. X    if grep 'Property of IBM' /usr/include/stdio.h >/dev/null 2>&1
  1509. X    then echo 'LIBS= -lcurses'
  1510. X    else echo 'LIBS= -ltermcap'
  1511. X    fi
  1512. Xelse echo 'LIBS= -lcurses'
  1513. Xfi
  1514. Xcat <<'foo'
  1515. X
  1516. XZSHPATH=zsh
  1517. X
  1518. X.c.o:
  1519. X    $(CC) $(CFLAGS) -c $<
  1520. X
  1521. Xall: $(ZSHPATH)
  1522. X
  1523. X$(ZSHPATH): $(OBJS)
  1524. X    $(CC) -o $(ZSHPATH) $(OBJS) $(LIBS) $(LFLAGS)
  1525. X    
  1526. Xtags: /tmp
  1527. X    ctags *.[cy]
  1528. X
  1529. X# I hate this next line
  1530. X$(OBJS): config.h zsh.h zle.h signals.h ztype.h funcs.h
  1531. X
  1532. Xclean:
  1533. X    rm -f *.o zsh core 
  1534. X
  1535. Xcleanall:
  1536. X    rm -f *.o zsh core Makefile signals.h config.h
  1537. X
  1538. Xinstall: zsh
  1539. X    install -s -m 755 zsh $(BINDIR)
  1540. X    install -m 444 ../man/man1/zsh.1 $(MANDIR)
  1541. Xfoo
  1542. Xexec 1>&2
  1543. Xcat <<'foo'
  1544. Xdone
  1545. X
  1546. XYou may want to look at the files I just created (config.h, Makefile,
  1547. Xand signals.h) to make sure they are correct.  Or you may just want
  1548. Xto go ahead and try running make now to see what happens.
  1549. X
  1550. Xfoo
  1551. Xecho 'Shall I execute make now?' | tr -d '\012' 
  1552. Xread reply
  1553. Xecho
  1554. Xcase "$reply" in
  1555. X[yY]*) exec make ;;
  1556. Xesac
  1557. X
  1558. SHAR_EOF
  1559. chmod 0755 zsh2.2/src/buildzsh ||
  1560. echo 'restore of zsh2.2/src/buildzsh failed'
  1561. Wc_c="`wc -c < 'zsh2.2/src/buildzsh'`"
  1562. test 11626 -eq "$Wc_c" ||
  1563.     echo 'zsh2.2/src/buildzsh: original size 11626, current size' "$Wc_c"
  1564. rm -f _shar_wnt_.tmp
  1565. fi
  1566. # ============= zsh2.2/src/builtin.c ==============
  1567. if test -f 'zsh2.2/src/builtin.c' -a X"$1" != X"-c"; then
  1568.     echo 'x - skipping zsh2.2/src/builtin.c (File already exists)'
  1569.     rm -f _shar_wnt_.tmp
  1570. else
  1571. > _shar_wnt_.tmp
  1572. echo 'x - extracting zsh2.2/src/builtin.c (Text)'
  1573. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/src/builtin.c' &&
  1574. X/*
  1575. SHAR_EOF
  1576. true || echo 'restore of zsh2.2/src/builtin.c failed'
  1577. fi
  1578. echo 'End of zsh2.2 part 5'
  1579. echo 'File zsh2.2/src/builtin.c is continued in part 6'
  1580. echo 6 > _shar_seq_.tmp
  1581. exit 0
  1582.  
  1583. exit 0 # Just in case...
  1584.